package com.newcapec.lesson3;


public class Driver extends Person implements Cloneable{
    private int cardId;
    private Car car;

    public Driver() {
    }

    public Driver(int cardId, Car car) {
        this.cardId = cardId;
        this.car = car;
    }

    public int getCardId() {
        return cardId;
    }

    public void setCardId(int cardId) {
        this.cardId = cardId;
    }

    public Car getCar() {
        return car;
    }

    public void setCar(Car car) {
        this.car = car;
    }

    @Override
    public String toString() {
        return "Driver{" +
                "cardId=" + cardId +
                ", car=" + car +
                '}';
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        Object obj = super.clone();
        Driver driver = (Driver) obj;
        driver.car = (Car) driver.car.clone();
        return driver;
    }

    @Override
    public void eat() {

    }
}
